#ifndef _MESSAGEIMPL_H_
#define _MESSAGEIMPL_H_

#include "stdafx.h"

class CMsgImpl : public IMsg, public CUnknownImp
{
public:
    CMsgImpl(void);
    virtual ~CMsgImpl(void);

    BEGIN_STDCOM_MAP
    STDCOM_INTERFACE_ENTRY(IMsg);
    END_STDCOM_MAP

    // IMsg
    std_method(SetMsgType)(unsigned int type);
    std_method_(unsigned int, GetMsgType)();
    std_method(SetId)(unsigned int id);
    std_method_(unsigned int, GetId)();
    std_method(SetVersion)(unsigned int version);
    std_method_(unsigned int, GetVersion)();
    std_method(SetLength)(unsigned int len);
    std_method_(unsigned int, GetLength)();
    std_method(SetMsgRawData)(BYTE* data, unsigned int size, unsigned int offset);
    std_method_(BYTE*, GetMsgRawData)(unsigned int offset);
    std_method(Clear)();
    std_method(Attach)(IMsg* pMsg);

private:
    std_method(Reset)();

public:
    unsigned int m_id;
    unsigned int m_version;
    unsigned int m_msgtype;
    unsigned int m_msglen;
    UCharArrayPtr m_pbuf;
};

#endif
